package model;

public class RealTile implements Tile{
	AreaEffect areaEffect;
	Item item;
	Location location;
	Map map;
	Terrain terrain;
	Entity entity;
	
	public RealTile()
	{
		super();
	}
	public RealTile(AreaEffect areaEffect, Item item, Location location,
			Map map, Terrain terrain) 
	{
		super();
		this.areaEffect = areaEffect;
		this.item = item;
		this.location = location;
		this.map = map;
		this.terrain = terrain;
	}
	public Tile getNeighbor(Direction direction)
	{
		Location locationTemp;
		switch (direction)
		{
		case NORTHEAST: 
			locationTemp = new Location((location.getX()+1), (location.getY()+1));
			break;
		case NORTH: 
			locationTemp = new Location(location.getX(), (location.getY()+1));
			break;
		case NORTHWEST: 
			locationTemp = new Location((location.getX()-1), (location.getY()+1));
			break;
		case WEST:
			locationTemp = new Location((location.getX()-1), (location.getY()));
			break;
		case SOUTHWEST:
			locationTemp = new Location((location.getX()-1), (location.getY()-1));
			break;
		case SOUTH:
			locationTemp = new Location((location.getX()), (location.getY()-1));
			break;
		case SOUTHEAST:
			locationTemp = new Location((location.getX()+1), (location.getY()-1));
			break;
		default:
			return(null);
		}
		
		return map.getRealTile(locationTemp);
	}
	
	
	public AreaEffect getAreaEffect() {
		return areaEffect;
	}

	public void setAreaEffect(AreaEffect areaEffect) {
		this.areaEffect = areaEffect;
	}

	public Item getItems() {
		return item;
	}

	public void setItems(Item item) {
		this.item = item;
	}

	public Location getLocation() {
		return location;
	}

	public void setLocation(Location location) {
		this.location = location;
	}

	public Map getMap() {
		return map;
	}

	public void setMap(Map map) {
		this.map = map;
	}

	public Terrain getTerrain() {
		return terrain;
	}

	public void setTerrain(Terrain terrain) {
		this.terrain = terrain;
	}

	public int getX()
	{
		return location.getX();
	}
	public int getY()
	{
		return location.getY();
	}
	public Entity getEntity() {
		return entity;
	}
	public void setEntity(Entity entity) {
		this.entity = entity;
	}
	public Item getItem() {
		return item;
	}
	public void setItem(Item item) {
		this.item = item;
	}
	
	
}
